package com.cjk.foundation.commons.response;

import java.io.Serializable;

public class Response implements Serializable {
	
	private static final long serialVersionUID = 5982802563714769544L;

	private boolean success;
	private String message;
	private Object data;

	public static Response error(String message) {
		return new Response(false, message, null);
	}

	public static Response success(String message, Object data) {
		return new Response(true, message, data);
	}

	public static Response success(Object data) {
		return new Response(true, "操作成功！", data);
	}
	
	public static Response success() {
		return new Response(true, "操作成功！", null);
	}

	protected Response(boolean success, String message, Object data) {
		super();
		this.success = success;
		this.message = message;
		this.data = data;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
